package houseHold.electricObjects;

import houseHold.ObjectType;

import java.util.Vector;

/**
 * Objects that use electricity
 * 
 * @author Minodor Class used for matching XML objects to java Objects
 */
public enum ElectricObjectType implements ObjectType {
	AIR_CONDITIONING, COFFEE_FILTER,MICROWAVE, COMPUTER, DISH_WASHER, ELECTRIC_OBJECT, ELECTRIC_PLATE, HAIR_DRYER, LIGHT, RADIATOR, REFRIGERATOR, TELEVISION, TOASTER, VACUUM_CLEANER, WASHING_MACHINE;
	public Vector<String> getList() {
		Vector<String> ret = new Vector<String>();
		for (ElectricObjectType e : ElectricObjectType.values()) {
			ret.add(e.toString());
		}
		ret.remove("ElectricObject");
		return ret;
	}

	public ElectricObjectType getObject(String s) {
		for (ElectricObjectType e : ElectricObjectType.values()) {
			if (e.toString().equalsIgnoreCase(s))
				return e;
		}
		return null;
	}

	public ObjectType match(String value) {
		return getObject(value);
	}

	@Override
	public String toString() {
		switch (this) {
		case HAIR_DRYER:
			return "Hair dyer";
		case MICROWAVE:
			return "Microwave";
		case ELECTRIC_PLATE:
			return "Electric plate";
		case VACUUM_CLEANER:
			return "Vacuum cleaner";
		case DISH_WASHER:
			return "Dish washer";
		case REFRIGERATOR:
			return "Refrigerator";
		case COMPUTER:
			return "Computer";
		case TELEVISION:
			return "Television";
		case LIGHT:
			return "Light";
		case WASHING_MACHINE:
			return "Washing machine";
		case AIR_CONDITIONING:
			return "Air conditioning";
		case COFFEE_FILTER:
			return "Coffee filter";
		case RADIATOR:
			return "Radiator";
		case TOASTER:
			return "Toaster";
		default:
			return "ElectricObject";
		}
	}
}
